#pragma once
#include <osg/Vec3d>

#include "CmdHandler3.h"

class Ent;
class Spline3D;
class FitCurve3DHandler : public CmdHandler3
{
	Q_OBJECT
public:
	Q_INVOKABLE FitCurve3DHandler();
	~FitCurve3DHandler();

	virtual void input(const QVariant& data, const QString& rawInput, CommandSource cs) override;

protected:
	std::shared_ptr<Spline3D> m_spline;
	std::set<std::shared_ptr<Ent>> m_usedEnts;
};

class LineStrip3D;
class PointHandler;
class Scene;
class FitPoints3DHandler : public CmdHandler3
{
	Q_OBJECT
public:
	Q_INVOKABLE FitPoints3DHandler();
	~FitPoints3DHandler();

	virtual void input(const QVariant& data, const QString& rawInput, CommandSource cs) override;
	void makeSpline(Scene* scene);

protected:
	std::shared_ptr<LineStrip3D> m_line;
	std::shared_ptr<Spline3D> m_spline;
	std::shared_ptr<PointHandler> m_pointStateMachine;
};
